home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dpkg.preinst < prev    next >
Text File  |  2008-09-03  |  1KB  |  55 lines

  1. #!/bin/sh -e
  2. # This script can be called in the following ways:
  3. #
  4. # Before the package is installed:
  5. #    <new-preinst> install
  6. #
  7. # Before removed package is upgraded:
  8. #    <new-preinst> install <old-version>
  9. #
  10. # Before the package is upgraded:
  11. #    <new-preinst> upgrade <old-version>
  12. #
  13. #
  14. # If postrm fails during upgrade or fails on failed upgrade:
  15. #    <old-preinst> abort-upgrade <new-version>
  16.  
  17. # Handle upgrades from pre-conffile dpkg.cfg
  18. upgrade_dpkg_non_conffile()
  19. {
  20.     if [ -r /etc/dpkg/dpkg.cfg ]; then
  21.     dpkg_cfg_md5="535552ad5ee9145dbc7a34c264df4e59  /etc/dpkg/dpkg.cfg"
  22.     if echo "$dpkg_cfg_md5" | md5sum -c >/dev/null 2>&1; then
  23.         echo "Removing non-modified dpkg.cfg to be replaced by a conffile ..."
  24.         rm -f /etc/dpkg/dpkg.cfg
  25.     fi
  26.     fi
  27. }
  28.  
  29.  
  30. case "$1" in
  31.     install)
  32.     ;;
  33.  
  34.     upgrade)
  35.     case "$2" in
  36.         # Upgrade from pre-conffile dpkg.cfg
  37.         1.9.21 | 1.10.* )
  38.         upgrade_dpkg_non_conffile
  39.         ;;
  40.     esac
  41.     ;;
  42.  
  43.     abort-upgrade)
  44.     ;;
  45.  
  46.  
  47.     *)
  48.     echo "$0 called with unknown argument \`$1'" 1>&2
  49.     exit 1
  50.     ;;
  51. esac
  52.  
  53.  
  54. exit 0
  55.